package com.sping.loadbalance;

import java.util.List;
import java.util.Random;

/**
 * @描述:随机策略（负载均衡）
 * @作者:Marks
 * @日期:23:09 2018-10-14
 * @版权:
 */
public class RandomLoadBalance implements LoadBalance {
    @Override
    public String select(List<String> repos) {
        int len = repos.size();
        //负载的算法
        Random random=new Random();
        return repos.get(random.nextInt(len));
    }
}
